import {View, Text, StyleSheet} from 'react-native';
import React from 'react';
import Login from './screens/Login';
import MallDetails from './screens/MallDetails';
import MallList from './screens/MallList';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';

//创建原生的栈式导航器，得到“导航器”对象和“屏幕”对象
let {Navigator, Screen} = createNativeStackNavigator();

export default function App() {
  return (
    //导航容器<=>路由器
    <NavigationContainer>
      {/* 导航器<=>路由列表 initialRouteName：初始路由名称(即默认首页)*/}
      <Navigator initialRouteName="mlist">
        {/* 屏幕<=>路由 */}
        <Screen name="login" component={Login} />
        <Screen name="mlist" component={MallList} />
        <Screen name="mdetails" component={MallDetails} />
        {/* RN属于原生App，没有地址栏，不用担心用户输入不存在的地址问题 */}
        {/* <Screen name="*" component={NotFound} /> */}
      </Navigator>
    </NavigationContainer>
  );
}
